package TimesheetManagemen;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
	public static void main(String args[]) throws ClassNotFoundException, SQLException  {
		ArrayList<Employee> employee = new ArrayList<Employee>();
		Employee emp = new Employee(25, "Nguyen Van A", "nva", "nva@gmail.com");
		Employee emp2 = new Employee(89, "Tran Quang Vinh", "vinhtq", "vinhtq@gmail.com");
		Employee emp3=new Employee(18,"le tri bao","baolt","baolt@gmail.com");
		Employee emp4=new Employee(11,"Le Huy Phuong","phuonglh","phuong@gmail.com");
		App app=new App();
		EmployeeDAO dao = new EmployeeDAO();
		ProjectDAO pjo=new ProjectDAO();
		TimesheetDAO ts = new TimesheetDAO();
//add Employee
//		dao.addEmp(emp);
// List Employee	
//		ArrayList<Employee> emps = dao.getEmployee();
//		System.out.println("id\t\tname\t\t\tusername\t\temail");
//		 for (int i = 0; i < emps.size(); i++) {
//		Employee em = emps.get(i);
//		System.out.println(em.getId() + "\t\t" + em.getName() + "\t\t" + em.getUsername() + "\t\t\t" + em.getEmail()); }
//Update Employee	
//		dao.updateEmp(emp);
//Delete Employee
//	    int kq=dao.deleteEmployee(89);
//		if(kq!=0){
//		System.out.println("Delete Successful");}
//		else{
//			System.out.println("Not Delete Successfull");
//		}
		
		ArrayList<Project> project = new ArrayList<Project>();
		Project pj = new Project(27, "CHE", 1420);
		Project pj2 = new Project(1, "DCB", 6);
		Project pj3=new Project(46,"IOC",14);
//add Project
//		pjo.addPj(pj);
//Update Project
//		pjo.updatePj(pj);
//Delete Project
//		int kq=pjo.deleteProject(9);
//		if(kq!=0){
//			System.out.println("Delete Successful");		}
//		else{
//			System.out.println("No Delete Successfull");
//		}
//List Project
//		ArrayList<Project> proj= pjo.getProject();
//			 System.out.println("id\t\tnameProject\t\ttimespend");
//		 for (int i = 0; i < proj.size(); i++) {
//		Project projt = proj.get(i);
//		System.out.println(projt.getId() + "\t\t" + projt.getNameProject()  + "\t\t\t" + projt.getTimespend()); }
        
		ArrayList<Timesheet> timesheet=new ArrayList<Timesheet>();
		Timesheet ts1=new Timesheet(15,"2014/11/1",18,"Technical Training","development","NO","TNHC",5,1);
		Timesheet ts2=new Timesheet(6,"2014/7/2",6,"Migration","development","NO","THNC",2,2);	
//add Timesheet
//		ts.addTs(ts1);
//Update Timesheet
//		ts.updateTs(ts1);
//Delete Timesheet
//		int kq=ts.deleteTimesheet(19);
//		if(kq!=0){
//			System.out.println("Delete Successful");
//		}
//		else{
//			System.out.println("Not Delete Successful");
//		}
//List Timesheet
//		ArrayList<Timesheet> tst=ts.getTimesheet();
//			 System.out.println("Id\t\tDate\t\t\tDuration\t\tDescription\t\tActivity\t\tOvertime\tLocation\tEmployeeid\tProjectid");
//		for(int i=0;i<tst.size();i++){
//			Timesheet show=tst.get(i);
//			System.out.println(show.getId() + "\t\t" + show.getDate()+"\t\t"+show.getDuration()+"\t\t\t" + show.getDescription() +"\t\t"+show.getActivity()+ "\t\t"+show.getOvertime()+"\t\t"+show.getLocation()+"\t\t"+show.getEmployeeid()+"\t\t"+show.getProjectid());
//		}
}}